package com.winning.pmph.entity;

import com.alibaba.fastjson.JSONArray;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import lombok.Data;

import javax.persistence.Table;

@Data
@Table(name = "KNOWLEDGE_LIB_FIELD")
public class KnowledgeLibField extends BaseEntity {
	private static final long serialVersionUID = 1L;

	// 字段类型
	/**
	 * 属性
	 */
	public final static int FIELD_KIND_STRINGTEXT = 0;
	/**
	 * 富文本
	 */
	public final static int FIELD_KIND_RICHEDITOR = 1;
	/**
	 * 参照
	 */
	public final static int FIELD_KIND_REFERENCE = 2;

	/**
	 * 单选下拉框
	 */
	public final static int FIELD_KIND_DROPDOWNLIST = 3;
	/**
	 * 图片
	 */
	public final static int FIELD_KIND_IMG = 4;

	/**
	 * 多选下拉列表
	 */
	public final static int FIELD_KIND_DROPMULTILIST = 5;

	/**
	 * 文本域
	 */
	public final static int FIELD_KIND_TEXTAREA = 6;

	/**
	 * 多值输入框
	 */
	public final static int FIELD_KIND_MULTI_VALUE_INPUT = 7;

	/**
	 * 关联本知识库
	 */
	public final static int FIELD_KIND_ASSOCIATE_CURRENT_KNOWLEDGE_LIB = 8;

	/**
	 * 关联其他知识库
	 */
	public final static int FIELD_KIND_ASSOCIATE_OTHER_KNOWLEDGE_LIB = 9;

	/**
	 * 关联应用平台
	 */
	public final static int FIELD_KIND_ASSOCIATE_PLATFORM = 10;

	/**
	 * 视频
	 */
	public final static int FIELD_KIND_VIDEO = 11;

    /**
     * 文件
     */
    public final static int FIELD_KIND_FILE = 12;

    /**
     * 文件, 计算器转知识, 组装属性, h5
     */
    public final static int CALCULATOR_FIELD_KIND_H5 = 13;

    /**
     * 音频
     */
    public final static int FIELD_KIND_AUDIO = 14;

    @TableId
    private String id;

    // 知识库ID
    private String knowledgeLibId;

    // 字段类型;0：属性，1：富文本，2：下拉列表
    private Integer kind;

	// 是否必填;0：不必填，1：必填
	private Boolean required;

	// 字段名称
	private String name;

	private String kindValue;

	@TableField("`index`")
	private int index;
	// 名称同义词, 用于素材库转知识, 字段匹配;
	private JSONArray synonym;
}
